<!doctype html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Binicare</title>
<script src="js/jquery-1.11.0.min.js"></script>
<link rel="stylesheet" href="css/style.css">
</head>
<body>

<div class="logo">
	<img src="img/logo.png">
</div>

<div class="votenotice">Voting results</div>

<div class="resultlist" id="resultlist">

</div>	

</body>
<script>
	ret_votes_list()
	function ret_votes_list(){

		$.ajax({
			url: "/admin/Ajax/ret_votes_list",
			type: "Post",
			async: false,
			cache: false,
			dataType: "json",
			success: function (res) {
				if (res.code == 1) {
					set_data(res.data);
					return
				} else {
					return set_data('');
				}
			},
			error:function (result) {
				console.log(result)
			}
		})
	}

	function set_data(data) {
		var str = '';
		$.each(data, function (i, val) {
			str = str + '<div class="resultinner">'
					+'<img src="'+val.logo+'">'
					+'<div class="resultvotes">'+val.votes+' votes</div>'
					+'</div>'

		});
		str = str ? str : '';
		$("#resultlist").html(str);
	}
</script>
</html>